import Request from '@/api/request'
var request = new Request().http

export interface OrderType {
	total : number,
	description : string,
	// 微信用户唯一标识
	openId : string
}
export interface ToPayData {
	timeStamp : string,
	nonceStr : string,
	wxPackage : string,
	signType : string,
	paySign : string,
	outTradeNo : string
}
//密码请求模板
export function login(data) {
	console.log(data, 211111111)
	return request({
		url: "/applet/user/login/password",
		method: "Post",
		data
	})
}
//微信登入请求模板
export function wxlogin(data) {
	return request({
		url: "/applet/user/login/wechat",
		method: "Post",
		Headers: {
			'content-type': "application/x-www-form-urlencoded",
		},
		data
	})
}
//加入志愿者
export function joinMe(data) {
	console.log(data, 211111111)
	return request({
		url: "/applet/user/volunteer",
		method: "Post",
		data
	})
}
// 获取列表
export function teamlist() {
	return request({
		url: "/applet/team/list",
		method: "Get",
	})
}
// 积分信息
export function workHourinfo() {
	return request({
		url: "/applet/user/workHour",
		method: "Get",
	})
}
export function userinfo() {
	return request({
		url: "/applet/user/info",
		method: "Get",
	})
}
export function toCloseOrder(outTradeNo : string) {
	return request({
		url: "/order/closeOrder",
		method: "Get",
		data: {
			outTradeNo
		}
	})
}
// 获取验证码
export function loginSendSms(outTradeNo : String) {
	console.log(outTradeNo)
	return request({
		url: "/applet/user/authCode",
		method: "Post",
		data: outTradeNo
	})
}
// 手机注册登录
export function register(data) {
	return request({
		url: "/applet/user/login/authCode",
		method: "Post",
		data
	})
}
// 查询状态
export function volunteer() {
	return request({
		url: "/applet/user/approve/volunteer",
		method: "Get"
	})
}
// 查询积分支付
export function getIntegralCode() {
	return request({
		url: "/applet/exchange/getIntegralCode",
		method: "Get"
	})
}
// 修改个人信息
export function editUserMsg(params) {
	return request({
		url: "/applet/user/modify",
		method: "Put",
		data: params
	})
}